package com.fh.modules.oas.controller;

import com.fh.common.api.vo.Result;
import com.fh.common.aspect.annotation.AutoLog;
import com.fh.common.constant.CommonConstant;
import com.fh.modules.oas.service.IOasTimesheetReportService;
import com.fh.modules.oas.vo.TimesheetVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author qiujunda
 * @Date 08/12/2019
 * @Description
 */
@RestController
@RequestMapping("/oas/oasTimesheetReport")
@Slf4j
@Api("工作日报报表")
public class OasTimeSheetReportController {

    @Autowired
    private IOasTimesheetReportService oasTimesheetReportService;

    @GetMapping(value = "/userGroup")
    @ApiOperation("分页列表查询")
    @AutoLog(value="工作日报分页查询",logType=CommonConstant.LOG_TYPE_QUERY)
    public Result queryReport(TimesheetVo vo) {
        return Result.ok(oasTimesheetReportService.queryReport(vo));
    }

    @GetMapping(value = "/userMantisReport")
    @ApiOperation("分页列表查询")
    @AutoLog(value="工作日报分页查询",logType=CommonConstant.LOG_TYPE_QUERY)
    public Result userMantisReport(TimesheetVo vo) {
        return Result.ok(oasTimesheetReportService.userMantisReport(vo));
    }

    @GetMapping(value = "/userMantisWorkloadReport")
    @ApiOperation("分页查询用户mantis工作量排名")
    @AutoLog(value="分页查询用户mantis工作量排名",logType=CommonConstant.LOG_TYPE_QUERY)
    public Result userMantisWorkloadReport(TimesheetVo vo) {
        return Result.ok(oasTimesheetReportService.userMantisWorkloadReport(vo));
    }
}
